package Day19;

import java.util.Scanner;

/**
 * Creat with IntelliJ IDEA
 * Description
 * User: mamba24
 * Date: 2022-10-10
 * Time: 8:39
 * To BE A Better Person-2020-3-2
 */
public class TestDemo {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while(true){
            int n=sc.nextInt();
            if(n==0){
                break;
            }
            if(n==1){
                System.out.println(0);
            }else if(n<=3){
                System.out.println(1);
            }else{
                System.out.println(n/2);
            }
        }
    }
}
